#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:Human.py
# author:张世航
# datetime:2024/11/13 00:07
# software: PyCharm
"""
this is function  description 
"""
# import module your need
# Human.py

class Human:
    def __init__(self, name):
        self.name = name
        self.health = 100
        self.attack_power = 10

    def attack(self, dog):
        if self.health <= 0:
            print(f"{self.name} is dead and cannot attack.")
            return

        dog.take_damage(self.attack_power)
        self.attack_power = max(self.attack_power - 2, 0)  # Reduce attack power when attacking
        print(f"{self.name} attacks {dog.name} for {self.attack_power} damage.")

    def take_damage(self, damage):
        self.health -= damage
        if self.health < 0:
            self.health = 0
        print(f"{self.name} takes {damage} damage and now has {self.health} health.")

    def is_alive(self):
        return self.health > 0